namespace FServer.Core.Entities;

public class UserSession
{
    public Guid Id { get; set; }
    
    public Guid UserId { get; set; }
    
    public User User { get; set; } = null!;
    
    [Required]
    [MaxLength(255)]
    public string TokenHash { get; set; } = string.Empty;
    
    [Required]
    [MaxLength(255)]
    public string RefreshTokenHash { get; set; } = string.Empty;
    
    public DateTime ExpiresAt { get; set; }
    
    public DateTime RefreshExpiresAt { get; set; }
    
    public string? IpAddress { get; set; }
    
    public string? UserAgent { get; set; }
    
    public string? DeviceInfo { get; set; }
    
    public bool IsActive { get; set; } = true;
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
